<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="mescroll.min.css">
</head>
<body>
	<div id="mescroll" class="mescroll">
        <ul>列表数据</ul>
	</div>
</body>
<script src='http://libs.baidu.com/jquery/1.11.1/jquery.min.js'></script>s
<script src="mescroll.min.js"></script>
<script>
	function all_order(userId){
		$('#all_order').html('');
		var num = 1;
		var page = 10;
		//创建MeScroll对象
		mescroll = new MeScroll("mescroll_all_order", {
			down: {
				use:false,
			},
			up: {
				auto: true, //是否在初始化时以上拉加载的方式自动加载第一页数据; 默认false
				isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
				callback: upCallback, //上拉回调,此处可简写; 相当于 callback: function (page) { upCallback(page); }
				offset : 100,
				empty:{
					warpId:"all_order",
					tip : "暂无数据" , 
				}
			}
		});
		/*上拉加载的回调 page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
		function upCallback(page){
			//联网加载数据
			var sendData = {
				num:userId,
				pageNum:page.num,
				pageSize:page.size
			}
			sendData = JSON.stringify(sendData);
			server.getData({postData:sendData},send_url+"/ordersystem/order/userId",function(data){
				if(data.code==0){
					mescroll.endBySize(data.data.length,data.count);
					$.each(data.data,function(i){
						var div	 = "<div><li>"+
							"<img src="+ data.data[i].productImage +" alt=''><div class='sale_text fl'>"+
							"<h3>"+ data.data[i].productName +"</h3><h5>"+  +"</h5><h6>￥"+ data.data[i].productName +"</h6><h6>￥"+ data.data[i].orderSum +"</h6>"+
							"</div><img class='sel_ed' src="+ data.data[i].productImage +" alt='' /></li><div class='bar'></div></div>";
							$('#all_order').append(div);
						num +=1;
					});
					$('#mescroll_all_order').remove('.mescroll-upwarp');
				}else{
					mescroll.errorCallback();
				}
			})
		}
	}
</script>
</html>